import 'package:flutter/material.dart';

// 绿色
const Color xmGreen = Color(0xFF95DC85);
// 蓝色
const Color xmBlue = Color(0xFF528FFB);
// 黄色
const Color xmYellow = Color(0xFFFAA732);
// 红色
const Color xmRed = Color(0xFFFF5906);
// 紫色
const Color xmPurple = Color(0xFFB378DF);

// 主题风格颜色
const MaterialColor xmPrimaryColor = MaterialColor(
  _xmPrimaryValue,
  <int, Color>{
    50: Color(0xFF528FFB),
    100: Color(0xFF528FFB),
    200: Color(0xFF528FFB),
    300: Color(0xFF528FFB),
    400: Color(0xFF528FFB),
    500: Color(_xmPrimaryValue),
    600: Color(0xFF528FFB),
    700: Color(0xFF528FFB),
    800: Color(0xFF528FFB),
    900: Color(0xFF528FFB),
  },
);
const int _xmPrimaryValue = 0xFF528FFB;

// 主题风格颜色 -- 首页背景色
const MaterialColor xmBgColor = MaterialColor(
  _xmBgValue,
  <int, Color>{
    50: Color(0xFFEFEFEF),
    100: Color(0xFFEFEFEF),
    200: Color(0xFFEFEFEF),
    300: Color(0xFFEFEFEF),
    400: Color(0xFFEFEFEF),
    500: Color(_xmBgValue),
    600: Color(0xFFEFEFEF),
    700: Color(0xFFEFEFEF),
    800: Color(0xFFEFEFEF),
    900: Color(0xFFEFEFEF),
  },
);
const int _xmBgValue = 0xFFEFEFEF;

class XMColor {
  static Color getColor(int colorInt) {
    if (colorInt == 0) {
      return xmGreen;
    } else if (colorInt == 1) {
      return xmBlue;
    } else if (colorInt == 2) {
      return xmYellow;
    } else if (colorInt == 3) {
      return xmRed;
    } else if (colorInt == 4) {
      return xmPurple;
    } else {
      return xmPrimaryColor;
    }
  }
}
